package com.bestcem.xm.ticket.service;

import com.alibaba.fastjson.JSONObject;
import com.bestcem.xm.common.core.domain.web.ServiceResult;
import com.bestcem.xm.ticket.controller.param.ticket.config.CreateConfigParam;
import com.bestcem.xm.ticket.controller.vo.ticket.config.TicketConfigInfoVO;
import com.bestcem.xm.ticket.entity.mongo.TicketRule;

import java.util.List;

/**
 * 工单规则Service
 *
 * @author jy.zhao
 * @version 1.0
 * @date 2021/8/17 20:01
 **/
public interface TicketRuleService {

    /**
     * 获取工单规则条件
     *
     * @param id
     * @return List
     * @author jy.zhao
     * @date 2021/8/17 20:17
     **/
    TicketRule.Condition getTicketRuleCondition(String id);

    /**
     * ticketConfigInfoVO 转化属性 statusRuleList方法
     *
     * @param ticketConfigInfoVO 工单配置前端显示对象
     * @return 转化完成的对象
     * @author liheng
     * @date 2021/8/19 17:36
     */
    TicketConfigInfoVO parseRuleJsonData(TicketConfigInfoVO ticketConfigInfoVO);


    /**
     * 初始化工单规则（创建工单配置使用）
     *
     * @param ticketConfigId 工单配置id
     * @param param          参数
     * @return 工单规则id
     * @author liheng
     * @date 2021/8/19 17:36
     */
    ServiceResult<String> createTicketRule(String ticketConfigId, CreateConfigParam param);

    /**
     * @param ticketConfigId
     * @param param
     * @return
     * @author liheng
     * @date 2021/8/25 13:55
     */
    List<JSONObject> initTicketStatusChangeRule(String ticketConfigId, CreateConfigParam param);

    /**
     * 修改工单规则
     *
     * @param ticketConfigId
     * @param ticketRules
     * @return
     * @author liheng
     * @date 2021/8/25 14:35
     */
    List<String> updateRulesV2(String ticketConfigId, List<TicketRule> ticketRules);

}
